package com.srzk.youthleagueback.controller;

import com.srzk.youthleagueback.results.Result;
import com.srzk.youthleagueback.service.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/admin/part4")
public class AdminPart4 {
    @Autowired
    ThematicEducationService thematicEducationService;
    @GetMapping("gradeThematicEducation")
    public Result<Map<String,Object>> getGradeThematicEducation(@Param("grade")String grade, @Param("year")String year){
        return thematicEducationService.getGradeList(grade,year);
    }
    @GetMapping("/historyThematicEducation")
    public Result<Map<String,Object>> getHistoryThematicEducation(@Param("user")String user){
        return thematicEducationService.getHistoryList(user);
    }

    @Autowired
    SportService sportService;
    @GetMapping("gradeSport")
    public Result<Map<String,Object>> getGradeSport(@Param("grade")String grade, @Param("year")String year){
        return sportService.getGradeList(grade,year);
    }
    @GetMapping("/historySport")
    public Result<Map<String,Object>> getHistorySport(@Param("user")String user){
        return sportService.getHistoryList(user);
    }

    @Autowired
    ProjectService projectService;
    @GetMapping("/gradeProject")
    public Result<Map<String,Object>> getGradeProject(@Param("grade")String grade, @Param("year")String year){
        return projectService.getGradeList(grade,year);
    }
    @GetMapping("/historyProject")
    public Result<Map<String,Object>> getHistoryProject(@Param("user")String user){
        return projectService.getHistoryList(user);
    }

    @Autowired
    CommuPlatService commuPlatService;
    @GetMapping("gradeCommuPlatform")
    public Result<Map<String,Object>> getGradeCommuPlatform(@Param("grade")String grade, @Param("year")String year){
        return commuPlatService.getGradeList(grade,year);
    }
    @GetMapping("/historyCommuPlatform")
    public Result<Map<String,Object>> getHistoryCommuPlatform(@Param("user")String user){
        return commuPlatService.getHistoryList(user);
    }

    @Autowired
    ShowPlatFormService showPlatFormService;
    @GetMapping("/gradeShowPlatform")
    public Result<Map<String,Object>> getGradePlatform(@Param("grade")String grade, @Param("year")String year){
        return showPlatFormService.getGradeList(grade,year);
    }
    @GetMapping("/historyPlatform")
    public Result<Map<String,Object>> getHistoryPlatform(@Param("user")String user){
        return showPlatFormService.getHistoryList(user);
    }

    @Autowired
    SocialPracticeService socialPracticeService;
    @GetMapping("/gradeSocialPractice")
    public Result<Map<String,Object>> getGradeSocialPractice(@Param("grade")String grade, @Param("year")String year){
        return socialPracticeService.getGradeList(grade,year);
    }
    @GetMapping("/historySocialPractice")
    public Result<Map<String,Object>> getHistorySocialPractice(@Param("user")String user){
        return socialPracticeService.getHistoryList(user);
    }

    @Autowired
    VolunteerService volunteerService;
    @GetMapping("/gradeVolunteer")
    public Result<Map<String,Object>> getGradeVolunteer(@Param("grade")String grade, @Param("year")String year){
        return volunteerService.getGradeList(grade,year);
    }
    @GetMapping("/historyVolunteer")
    public Result<Map<String,Object>> getHistoryVolunteer(@Param("user")String user){
        return volunteerService.getHistoryList(user);
    }

    @Autowired
    InnovationService innovationService;
    @GetMapping("/gradeInnovation")
    public Result<Map<String,Object>> getGradeInnovation(@Param("grade")String grade, @Param("year")String year){
        return innovationService.getGradeList(grade,year);
    }
    @GetMapping("/historyInnovation")
    public Result<Map<String,Object>> getHistoryInnovation(@Param("user")String user){
        return innovationService.getHistoryList(user);
    }

    @Autowired
    EquityService equityService;
    @GetMapping("/gradeEquity")
    public Result<Map<String,Object>> getGradeEquity(@Param("grade")String grade, @Param("year")String year){
        return equityService.getGradeList(grade,year);
    }
    @GetMapping("/historyEquity")
    public Result<Map<String,Object>> getHistoryEquity(@Param("user")String user){
        return equityService.getHistoryList(user);
    }
}
